package lumis.portal.metatag;

import java.util.List;

import lumis.portal.PortalException;
import lumis.portal.authentication.SessionConfig;
import lumis.util.ITransaction;

/**
 * Manager for all meta-tag related information
 *
 * @version $Revision: 7370 $ $Date: 2007-06-12 13:50:49 -0300 (Tue, 12 Jun 2007) $
 * @since 4.0.11
 */
public interface IMetaTagManager
{
	/**
	 * Get a meta-tag object
	 * 
	 * @param sessionConfig
	 * @param id
	 * @param transaction
	 * @return
	 * @throws PortalException
	 * @since 4.0.11
	 */
	public MetaTagConfig get(SessionConfig sessionConfig, String id, ITransaction transaction) throws PortalException;

	/**
	 * Get a list of meta-tag ids given the parent channelId or pageId
	 * 
	 * @param sessionConfig
	 * @param parentId
	 * @param transaction
	 * @return
	 * @throws PortalException
	 * @since 4.0.11
	 */
	public List<String> getIdsByParentId(SessionConfig sessionConfig, String parentId, ITransaction transaction) throws PortalException;

	/**
	 * Adds a meta-tag
	 * 
	 * @param sessionConfig
	 * @param metaTagConfig
	 * @param transaction
	 * @return
	 * @throws PortalException
	 * @since 4.0.11
	 */
	public String add(SessionConfig sessionConfig, MetaTagConfig metaTagConfig, ITransaction transaction) throws PortalException;

	/**
	 * Update a meta-tag. If the meta-tag don't exist, it is
	 * added.
	 * 
	 * @param sessionConfig
	 * @param metaTagConfig
	 * @param transaction
	 * @throws PortalException
	 * @since 4.0.11
	 */
	public void addOrUpdate(SessionConfig sessionConfig, MetaTagConfig metaTagConfig, ITransaction transaction) throws PortalException;

	/**
	 * Update a meta-tag configuration.
	 * 
	 * @param sessionConfig
	 * @param metaTagConfig
	 * @param transaction
	 * @throws PortalException
	 * @since 4.0.11
	 */
	public void update(SessionConfig sessionConfig, MetaTagConfig metaTagConfig, ITransaction transaction) throws PortalException;

	/**
	 * Delete a meta-tag.
	 * 
	 * @param sessionConfig
	 * @param id
	 * @param transaction
	 * @throws PortalException
	 * @since 4.0.11
	 */
	public void delete(SessionConfig sessionConfig, String id, ITransaction transaction) throws PortalException;
}
